package com.smarttiger.zero.admin.util;

import cn.hutool.cache.Cache;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.LRUCache;
import cn.hutool.core.date.DateUnit;
import com.smarttiger.zero.admin.entity.InterfaceModel;
import com.smarttiger.zero.admin.entity.LogsModel;

import java.util.List;

/**
 * Created by zhouzhengwei on 2021/10/25.
 */
public class ZEROCacheUtil {

    static public Cache<String,List<LogsModel>> logsCache = cn.hutool.cache.CacheUtil.newWeakCache(DateUnit.SECOND.getMillis() * 2);

    static public Cache<String,List<InterfaceModel>> interfaceCache = cn.hutool.cache.CacheUtil.newTimedCache(DateUnit.MINUTE.getMillis() * 30);

    static public LRUCache lruCache = cn.hutool.cache.CacheUtil.newLRUCache(100);

    static public Cache<String, String> userSession = CacheUtil.newTimedCache(DateUnit.MINUTE.getMillis() * 60 * 4);
}
